package com.baseproject.adapter;

import android.content.Context;
import android.view.KeyEvent;
import android.view.ViewGroup;

/**
 * Created by hp on 2017/3/3.
 */

public interface ItemViewDelegate<T> {

    int getItemViewLayoutId();

    int getItemViewType();

    ViewHolder createViewHolder(Context context, ViewGroup parent);


    /**
     * 通过delegatemanager将onBindViewHolder分发给每个delegate
     * @param holder
     * @param position 当前delegateType内部的position，非全局(整个recyclerview)position
     */
    void convert(ViewHolder holder, int position);

    void updateData(T t);

    int getItemCount();

    boolean onKeyDown(int keyCode, KeyEvent event);
}
